package com.dh.design.abstractFactory;

/**
 * @author dh
 * @date 2020/10/31 15:26
 * @Description: 通过传递形状或颜色信息来获取工厂
 */
public class FactoryProducer {

    public static AbstractFactory getAbstractFactory(String choice) {
        if ("shape".equalsIgnoreCase(choice)) {
            return new ShapeFactory();
        } else if ("color".equalsIgnoreCase(choice)) {
            return new ColorFactory();
        }
        return null;
    }
}
